package com.link2room.blaster.entity;

import com.link2room.common.entity.BaseEntity;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Created by LN on 2016/9/12.
 */
@Entity
@Table(name = "msg_template")
public class MsgTemplate extends BaseEntity{
    private String channel;
    private String templateId;
    private String template;
    private String code;
    private String dayuSignName;

    @Basic
    @Column(name = "channel", nullable = false, length = 16)
    public String getChannel() {
        return channel;
    }

    public void setChannel(String channel) {
        this.channel = channel;
    }

    @Basic
    @Column(name = "template_id", nullable = true, length = 64)
    public String getTemplateId() {
        return templateId;
    }

    public void setTemplateId(String templateId) {
        this.templateId = templateId;
    }

    @Basic
    @Column(name = "template", nullable = true, length = 255)
    public String getTemplate() {
        return template;
    }

    public void setTemplate(String template) {
        this.template = template;
    }
    @Basic
    @Column(name = "code",length = 32)
    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    @Basic
    @Column(name = "dayu_sign_name",length = 32)
    public String getDayuSignName() {
        return dayuSignName;
    }

    public void setDayuSignName(String dayuSignName) {
        this.dayuSignName = dayuSignName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        MsgTemplate that = (MsgTemplate) o;

        if (channel != null ? !channel.equals(that.channel) : that.channel != null) return false;
        if (templateId != null ? !templateId.equals(that.templateId) : that.templateId != null) return false;
        if (template != null ? !template.equals(that.template) : that.template != null) return false;
        if (code != null ? !code.equals(that.code) : that.code != null) return false;
        return dayuSignName != null ? dayuSignName.equals(that.dayuSignName) : that.dayuSignName == null;
    }

    @Override
    public int hashCode() {
        int result = channel != null ? channel.hashCode() : 0;
        result = 31 * result + (templateId != null ? templateId.hashCode() : 0);
        result = 31 * result + (template != null ? template.hashCode() : 0);
        result = 31 * result + (code != null ? code.hashCode() : 0);
        result = 31 * result + (dayuSignName != null ? dayuSignName.hashCode() : 0);
        return result;
    }
}
